package com.zhuoli.service.springboot.test.util.controller;

import com.zhuoli.service.springboot.test.util.common.request.DoPostRequest;
import com.zhuoli.service.springboot.test.util.service.PostControllerService;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhuoli
 * @Date: 2018/9/6 13:37
 * @Description:
 */
@RestController
@RequestMapping("/user")
@AllArgsConstructor
public class PostController {

    private PostControllerService postControllerService;

    @RequestMapping(value = "/do_post", method = RequestMethod.POST)
    public ResponseEntity doPost(@RequestBody DoPostRequest doPostRequest){
        return ResponseEntity.status(HttpStatus.OK).body(postControllerService.postUrl(doPostRequest));
    }
}
